#include <stm8s_clk.h>

void CLK_FastHaltWakeUpCmd(FunctionalState NewState)
{
  /* check the parameters */
  assert_param(IS_FUNCTIONALSTATE_OK(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set FHWU bit (HSI oscillator is automatically switched-on) */
    CLK->ICKR |= CLK_ICKR_FHWU;
  }
  else  /* FastHaltWakeup = DISABLE */
  {
    /* Reset FHWU bit */
    CLK->ICKR &= (uint8_t)(~CLK_ICKR_FHWU);
  }
}

/**
  * @brief  Enable or Disable the External High Speed oscillator (HSE).
  * @param   NewState new state of HSEEN, value accepted ENABLE, DISABLE.
  * @retval None
  */
